﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LeftServerTab : MonoBehaviour
{
    public UILabel labName;
    private int startServerId;
    private int endServerId;
    public UIToggle toggle;

    public void Init(int startId, int endId)
    {
        startServerId = startId;
        endServerId = endId;
        labName.text = string.Format("{0}-{1}区", startServerId, endServerId);

        toggle.onChange.Add(new EventDelegate(()=>
        {
            if (toggle.value == true)
            {
                ServerListPanel.Instance.ChangeServerList(this.startServerId, this.endServerId);
            }
        }));

        if (startId == 1)
        {
            toggle.startsActive = true;
        }
    }
}
